package com.arron.algorithm;

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @Classname ArrayTest1
 * @Date 2020/9/20 16:31
 * @Created by 刘
 * <p>
 * 旋转数组：
 */
public class ArrayTest1 {


    public static void main(String[] args) {

        System.out.println("");

    }

    public Set<String> findLongTracks(List<Album> albums) {
        return albums.stream()
                .flatMap(album -> album.getTrackList().stream())
                .filter(track -> track.getLength() > 60)
                .map(track -> track.getName())
                .collect(Collectors.toSet());
    }
}

class Album {

    private List<Track> trackList;

    public List<Track> getTrackList() {
        return trackList;
    }
}

class Track {
    private int length;

    private String name;

    public String getName() {
        return name;
    }

    public int getLength() {
        return length;
    }
}
